package com.fbs.wowo.base;

import com.fbs.wowo.exception.ErrorCode;

/**
 * Controller基类，用于封装返回给前端的json对象
 */
public abstract class BaseController {
    protected Response success() {
        return Response.success();
    }
    protected Response success(Object data) {
        return Response.success(data);
    }
    protected Response failed(String msg) {
        return Response.failed(msg);
    }
    protected Response failed(ErrorCode error) {
        return Response.failed(error.getMsg(), error.getStatus());
    }
    protected Response failed(String msg, String status) {
        return Response.failed(msg, status);
    }
}
